home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / noweb / contrib / partingr / xpand < prev   
Text File  |  1995-02-24  |  524b  |  21 lines

  1. #!/usr/common/bin/perl
  2. while(<>)
  3. {
  4. # expand wildcard references here, then process as normal
  5.   if(/^@(use|defn) (.*)$/)
  6.     {
  7.       $action=$1;
  8.       if($2=~/\.{3}$/)
  9.       { @matches=grep(/^$2.*/i,split(/ñ/,$known));
  10.         if($#matches>0)
  11.           { die "\nAmbiguous module name `$mod...'"; }
  12.         elsif($#matches==-1)
  13.           { die "\nNo match for name `$mod...',line $i "; }
  14.         else
  15.           { $mn=@matches[0]; $_="@$action $mn\n"; }
  16.       }
  17.       else { $known=$known . "ñ$2"; }
  18.     }
  19.   print STDOUT $_;
  20. }
  21.